package com.dubito.dose.feature.home.navigation

import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.composable
import com.dubito.dose.core.navigation.DoseNavigationDestination
import com.dubito.dose.feature.home.HomeRoute

/**
 * author: LiLiang
 * createTime: 2022/9/3-18:51
 * remark:
 **/
object HomeDestination : DoseNavigationDestination {

    override val route: String
        get() = "home_route"
    override val destination: String
        get() = "home_destination"
}

fun NavGraphBuilder.homeGraph(
    bottomBarVisibility: MutableState<Boolean>,
    fabVisibility: MutableState<Boolean>
) {
    composable(route = HomeDestination.route) {
        LaunchedEffect(null) {
            bottomBarVisibility.value = true
            fabVisibility.value = true
        }
        HomeRoute()
    }
}